package edu.fudan.jwxt.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

@Data
@TableName("course")
public class Course {

    @TableId(value = "aid",type = IdType.AUTO)
    private Integer aid;

    private String courseId;    //课程序号
    private String courseName;  //课程名称
    private Integer collegeId;   //所属学院类别
    private Integer majorId;    // 所属专业id
    private Integer hours;   // 学时
    private Integer credits;
    private String introduction;
    private Integer capacity;

    private void DefaultCourse(){
        courseId="LIZENG1234";
        courseName="testCourse";
        collegeId=10;
        majorId=3;
        hours=6;
        credits=1;
        introduction="ForTest";
        capacity=12;
    }

    public Course(String[] temp){
        setCourseId(temp[0]);
        setCourseName(temp[1]);
        setCollegeId(Integer.parseInt(temp[3]));
        setMajorId(Integer.parseInt(temp[4]));
        setHours(Integer.parseInt(temp[5]));
        setCredits(Integer.parseInt(temp[6]));
        setIntroduction(temp[7]);
        setCapacity(Integer.parseInt(temp[8]));
    }

//    public Course(CourseTeacherRequest course) {
//        this.aid = course.getAid();
//        this.courseId = course.getCourseId();
//        this.courseName = course.getCourseName();
//        this.collegeId = course.getCollegeId();
//        this.majorId = course.getMajorId();
//        this.hours = course.getHours();
//        this.credits = course.getCredits();
//        this.introduction = course.getIntroduction();
//        this.capacity = course.getCapacity();
//    }



    public Course(){
        DefaultCourse();
        //courseId= UUID.randomUUID().toString().replaceAll("-","");
    }

    public Course(String courseIdCopy){
        DefaultCourse();
        setCourseId(courseIdCopy);
    }







    /*
    @TableField(select = false)
    private String teacherName;     //老师名称
    */

}
